package com.lmiot.xyclick.Share;

import android.content.Context;
import android.content.Intent;
import android.os.Environment;
import android.text.Html;
import android.text.TextUtils;
import android.view.View;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.lmiot.xyclick.Util.SpFlag;
import com.google.gson.Gson;
import com.lmiot.xyclick.AD.SDK.ADSDK;
import com.lmiot.xyclick.Activity.PayVIPActivity;
import com.lmiot.xyclick.Activity.WebViewActivity;
import com.lmiot.xyclick.App.MyApp;
import com.lmiot.xyclick.Bean.SQL.ActionBean;
import com.lmiot.xyclick.Bean.SQL.ActionBeanSqlUtil;
import com.lmiot.xyclick.Bean.SQL.AutoBean;
import com.lmiot.xyclick.Bean.SQL.AutoBeanSqlUtil;
import com.lkx.liandianqinew.R;
import com.lmiot.xyclick.Share.Bean.AddFilePointBean;
import com.lmiot.xyclick.Share.Bean.AddMsgBean;
import com.lmiot.xyclick.Share.Bean.AdminFileBean;
import com.lmiot.xyclick.Share.Bean.AdminMsgBean;
import com.lmiot.xyclick.Share.Bean.DownloadFileBean;
import com.lmiot.xyclick.Share.Bean.DownloadFileBeanRes;
import com.lmiot.xyclick.Share.Bean.NoteFileBean;
import com.lmiot.xyclick.Share.Bean.SearchFileBean;
import com.lmiot.xyclick.Share.Bean.SearchFileBeanByMy;
import com.lmiot.xyclick.Share.Bean.SearchFileBeanByName;
import com.lmiot.xyclick.Share.Bean.SearchFileBeanByTop;
import com.lmiot.xyclick.Share.Bean.SearchFileBeanByType;
import com.lmiot.xyclick.Share.Bean.SearchFileBeanRes;
import com.lmiot.xyclick.Share.Bean.SearchMsgBean;
import com.lmiot.xyclick.Share.Bean.SearchMsgBeanRes;
import com.lmiot.xyclick.Share.Bean.UploadFileBean;
import com.lmiot.xyclick.Share.inteface.OnAutoIDListener;
import com.lmiot.xyclick.Share.inteface.OnDownListener;
import com.lmiot.xyclick.Share.inteface.OnMsgListener;
import com.lmiot.xyclick.Share.inteface.OnSearchListener;
import com.lmiot.xyclick.Util.DataUtil;
import com.lmiot.xyclick.Util.HttpUtilNew;
import com.lmiot.xyclick.Util.LogUtil;
import com.lmiot.xyclick.Util.PhoneUtil;
import com.lmiot.xyclick.Util.TimeUtils;
import com.lmiot.xyclick.Util.ZipUtilOld;
import com.lmiot.xyclick.inteface.OnBasicListener;
import com.xiaoyi.intentsdklibrary.Bean.ShareBean;
import com.youyi.yychosesdk.utils.file.FileUtils;
import com.youyi.yyviewsdklibrary.ArrayGson;
import com.youyi.yyviewsdklibrary.Dialog.core.XDialog;
import com.youyi.yyviewsdklibrary.Dialog.interfaces.OnViewBack;
import com.youyi.yyviewsdklibrary.Dialog.util.ToastUtil;
import com.youyi.yyviewsdklibrary.YYSDK;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.builder.PostStringBuilder;
import com.zhy.http.okhttp.callback.StringCallback;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import okhttp3.Call;
import okhttp3.MediaType;

public class ShareSDK {
    private static final String TAG = "ShareSDK";
    private static final ShareSDK ourInstance = new ShareSDK();
    private Intent mIntent;

    public static ShareSDK getInstance() {
        return ourInstance;
    }

    private ShareSDK() {
    }

    public void downShare(final Context context, final ShareBean shareBean, final OnBasicListener onBasicListener) {
        HttpUtilNew.getInstance().freshPoint(new OnBasicListener() {
            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass1 */

            @Override // com.lmiot.xyclick.inteface.OnBasicListener
            public void result(boolean z, String str) {
                if (z) {
                    final int shareFen = DataUtil.getShareFen(context);
                    final int need_acc_point = shareBean.getNeed_acc_point();
                    ShareSDK.this.downTipDialog(context, shareFen, need_acc_point, new OnBasicListener() {
                        /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass1.AnonymousClass1 */

                        @Override // com.lmiot.xyclick.inteface.OnBasicListener
                        public void result(boolean z, String str) {
                            if (!z) {
                                return;
                            }
                            if (shareFen < need_acc_point) {
                                ShareSDK.this.addPoint(context, null);
                            } else if (DataUtil.getVip(MyApp.getContext())) {
                                ShareSDK.this.downMethod(shareBean, onBasicListener);
                            } else {
                                ADSDK.getInstance().chosADShow(context, false, new ADSDK.OnADFinishListener() {
                                    /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass1.AnonymousClass1.AnonymousClass1 */

                                    @Override // com.lmiot.xyclick.AD.SDK.ADSDK.OnADFinishListener
                                    public void result(boolean z) {
                                        if (z) {
                                            ShareSDK.this.downMethod(shareBean, onBasicListener);
                                        }
                                    }
                                });
                            }
                        }
                    });
                    return;
                }
                ToastUtil.err("网络请求失败！");
            }
        });
    }

    public void addPoint(Context context, final OnBasicListener onBasicListener) {
        ADSDK.getInstance().chosADShow(context, false, new ADSDK.OnADFinishListener() {
            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass2 */

            @Override // com.lmiot.xyclick.AD.SDK.ADSDK.OnADFinishListener
            public void result(boolean z) {
                if (z) {
                    int freePoint = DataUtil.getFreePoint(TimeUtils.getAlarmTimeDay());
                    if (freePoint > 0) {
                        ToastUtil.success("赚取积分成功！");
                        DataUtil.setFreePoint(TimeUtils.getAlarmTimeDay(), freePoint - 1);
                        ShareSDK.getInstance().addPoit(PhoneUtil.getIMEI(MyApp.getContext()), MyApp.getContext().getPackageName(), TimeUtils.createID(), TimeUtils.createID(), 200, new OnBasicListener() {
                            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass2.AnonymousClass1 */

                            @Override // com.lmiot.xyclick.inteface.OnBasicListener
                            public void result(boolean z, String str) {
                                HttpUtilNew.getInstance().freshPoint(new OnBasicListener() {
                                    /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass2.AnonymousClass1.AnonymousClass1 */

                                    @Override // com.lmiot.xyclick.inteface.OnBasicListener
                                    public void result(boolean z, String str) {
                                        if (onBasicListener != null) {
                                            onBasicListener.result(true, "");
                                        }
                                    }
                                });
                            }
                        });
                        return;
                    }
                    ToastUtil.warning("今天赚积分次数已超，请明天再试！");
                    if (onBasicListener != null) {
                        onBasicListener.result(false, "");
                        return;
                    }
                    return;
                }
                ToastUtil.err("需要观看完整广告哦！");
                OnBasicListener onBasicListener2 = onBasicListener;
                if (onBasicListener2 != null) {
                    onBasicListener2.result(false, "");
                }
            }
        });
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void downMethod(ShareBean shareBean, OnBasicListener onBasicListener) {
        getInstance().downFile(PhoneUtil.getIMEI(MyApp.getContext()), shareBean.getScript_id(), new OnDownListener() {
            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass3 */

            @Override // com.lmiot.xyclick.Share.inteface.OnDownListener
            public void result(List<DownloadFileBeanRes.BodyBean.DataBean.ScriptListBean> list) {
                try {
                    final DownloadFileBeanRes.BodyBean.DataBean.ScriptListBean scriptListBean = list.get(0);
                    final String script_type_id = scriptListBean.getScript_type_id();
                    ActionBeanSqlUtil.getInstance().delByID(script_type_id);
                    File file = new File(Environment.getExternalStorageDirectory() + "/XYclick/data", script_type_id + "." + DataUtil.FILE_XYCLICK_DATA);
                    if (!file.exists()) {
                        file.createNewFile();
                    }
                    com.lmiot.xyclick.Util.FileUtils.base64StringToFile(scriptListBean.getScript_context(), file.getAbsolutePath());
                    final File file2 = new File(Environment.getExternalStorageDirectory() + "/XYclick/temp");
                    ZipUtilOld.upZipFile(file, file2.getAbsolutePath(), new ZipUtilOld.UnZipListener() {
                        /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass3.AnonymousClass1 */

                        @Override // com.lmiot.xyclick.Util.ZipUtilOld.UnZipListener
                        public void result(boolean z) {
                            try {
                                File[] listFiles = file2.listFiles();
                                for (File file : listFiles) {
                                    if (file.getName().equals(script_type_id + "." + DataUtil.FILE_ACTION_DATA)) {
                                        ActionBeanSqlUtil.getInstance().addList01(new ArrayGson().fromJsonList(com.lmiot.xyclick.Util.FileUtils.readFileToString(file), ActionBean.class));
                                    }
                                }
                                for (File file2 : listFiles) {
                                    if (file2.getName().equals(script_type_id + "." + DataUtil.FILE_AUTO_DATA)) {
                                        String readFileToString = com.lmiot.xyclick.Util.FileUtils.readFileToString(file2);
                                        String user_scene = scriptListBean.getUser_scene();
                                        String account_id = scriptListBean.getAccount_id();
                                        AutoBean autoBean = (AutoBean) new Gson().fromJson(readFileToString, AutoBean.class);
                                        autoBean.setIsShareAuto(!account_id.equals(PhoneUtil.getIMEI(MyApp.getContext())));
                                        autoBean.setShareUserID(account_id);
                                        if (TextUtils.isEmpty(user_scene)) {
                                            autoBean.setIsLocked(false);
                                            autoBean.setPassword("");
                                        } else {
                                            autoBean.setIsLocked(true);
                                            autoBean.setPassword(user_scene);
                                        }
                                        AutoBeanSqlUtil.getInstance().add(autoBean);
                                    }
                                }
                            } catch (Exception e) {
                                e.printStackTrace();
                            } catch (Throwable th) {
                                ToastUtil.success("下载成功，请到首页查看！");
                                throw th;
                            }
                            ToastUtil.success("下载成功，请到首页查看！");
                        }
                    });
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    public void upLoadFile(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, String str9, int i, String str10, String str11, String str12, String str13, boolean z, int i2, final OnBasicListener onBasicListener) {
        UploadFileBean uploadFileBean = new UploadFileBean();
        UploadFileBean.HeadBean headBean = new UploadFileBean.HeadBean();
        headBean.setCmd("4001");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        UploadFileBean.BodyBean.ResultBean resultBean = new UploadFileBean.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        UploadFileBean.BodyBean.DataBean dataBean = new UploadFileBean.BodyBean.DataBean();
        dataBean.setScript_type_code(str);
        dataBean.setScript_name(str3);
        dataBean.setAccount_id(str4);
        dataBean.setScript_type_id(str2);
        dataBean.setScript_img(str5);
        dataBean.setScript_note(str6);
        dataBean.setScript_context(str7);
        dataBean.setScript_size(str8);
        dataBean.setScript_pwd(str9);
        dataBean.setScript_action_sum(i);
        dataBean.setUser_scene(str10);
        dataBean.setPhone_size(str11);
        dataBean.setSoft_code(str12);
        dataBean.setSoft_version_code(str13);
        dataBean.setEnabled_down(z ? 1 : 0);
        dataBean.setNeed_acc_point(i2);
        UploadFileBean.BodyBean bodyBean = new UploadFileBean.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        uploadFileBean.setHead(headBean);
        uploadFileBean.setBody(bodyBean);
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/add")).content(new Gson().toJson(uploadFileBean)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass4 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                if (onBasicListener != null) {
//                    onBasicListener.result(false, "");
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                LogUtil.d(ShareSDK.TAG, "onResponse:" + str);
//                if (onBasicListener != null) {
//                    onBasicListener.result(true, "");
//                }
//            }
//        });
    }

    public void editFile(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, String str9, String str10, int i, String str11, String str12, String str13, String str14, boolean z, int i2, final OnBasicListener onBasicListener) {
        UploadFileBean uploadFileBean = new UploadFileBean();
        UploadFileBean.HeadBean headBean = new UploadFileBean.HeadBean();
        headBean.setCmd("4001");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        UploadFileBean.BodyBean.ResultBean resultBean = new UploadFileBean.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        UploadFileBean.BodyBean.DataBean dataBean = new UploadFileBean.BodyBean.DataBean();
        dataBean.setScript_id(str);
        dataBean.setScript_type_code(str2);
        dataBean.setScript_name(str4);
        dataBean.setAccount_id(str5);
        dataBean.setScript_type_id(str3);
        dataBean.setScript_img(str6);
        dataBean.setScript_note(str7);
        dataBean.setScript_context(str8);
        dataBean.setScript_size(str9);
        dataBean.setScript_pwd(str10);
        dataBean.setScript_action_sum(i);
        dataBean.setUser_scene(str11);
        dataBean.setPhone_size(str12);
        dataBean.setSoft_code(str13);
        dataBean.setSoft_version_code(str14);
        dataBean.setEnabled_down(z ? 1 : 0);
        dataBean.setNeed_acc_point(i2);
        UploadFileBean.BodyBean bodyBean = new UploadFileBean.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        uploadFileBean.setHead(headBean);
        uploadFileBean.setBody(bodyBean);
        LogUtil.d(TAG, "上传数据：" + new Gson().toJson(uploadFileBean));
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/add")).content(new Gson().toJson(uploadFileBean)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass5 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                if (onBasicListener != null) {
//                    onBasicListener.result(false, "");
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                LogUtil.d(ShareSDK.TAG, "onResponse:" + str);
//                if (onBasicListener != null) {
//                    onBasicListener.result(true, "");
//                }
//            }
//        });
    }

    public void searchSelfFile(String str, final OnSearchListener onSearchListener) {
        SearchFileBeanByMy searchFileBeanByMy = new SearchFileBeanByMy();
        SearchFileBeanByMy.HeadBean headBean = new SearchFileBeanByMy.HeadBean();
        headBean.setCmd("4002");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        SearchFileBeanByMy.BodyBean.ResultBean resultBean = new SearchFileBeanByMy.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        SearchFileBeanByMy.BodyBean.DataBean dataBean = new SearchFileBeanByMy.BodyBean.DataBean();
        dataBean.setAccount_id(str);
        SearchFileBeanByMy.BodyBean bodyBean = new SearchFileBeanByMy.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        searchFileBeanByMy.setHead(headBean);
        searchFileBeanByMy.setBody(bodyBean);
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/qry")).content(new Gson().toJson(searchFileBeanByMy)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass6 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                OnSearchListener onSearchListener = onSearchListener;
//                if (onSearchListener != null) {
//                    onSearchListener.result(false, null);
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                try {
//                    List<ShareBean> script_list = ((SearchFileBeanRes) new Gson().fromJson(str, SearchFileBeanRes.class)).getBody().getData().getScript_list();
//                    OnSearchListener onSearchListener = onSearchListener;
//                    if (onSearchListener != null) {
//                        onSearchListener.result(true, script_list);
//                    }
//                } catch (Exception e) {
//                    e.printStackTrace();
//                    OnSearchListener onSearchListener2 = onSearchListener;
//                    if (onSearchListener2 != null) {
//                        onSearchListener2.result(true, null);
//                    }
//                }
//            }
//        });
    }

    public void searchByAutoID(final String str, final OnAutoIDListener onAutoIDListener) {
        searchSelfFile(PhoneUtil.getIMEI(MyApp.getContext()), new OnSearchListener() {
            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass7 */

            @Override // com.lmiot.xyclick.Share.inteface.OnSearchListener
            public void result(boolean z, List<ShareBean> list) {
                String str2;
                try {
                    Iterator<ShareBean> it = list.iterator();
                    while (true) {
                        if (!it.hasNext()) {
                            str2 = null;
                            break;
                        }
                        ShareBean next = it.next();
                        if (next.getScript_type_id().equals(str)) {
                            str2 = next.getScript_id();
                            break;
                        }
                    }
                    if (onAutoIDListener != null) {
                        onAutoIDListener.result(str2);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    OnAutoIDListener onAutoIDListener2 = onAutoIDListener;
                    if (onAutoIDListener2 != null) {
                        onAutoIDListener2.result(null);
                    }
                }
            }
        });
    }

    public void searchFileByName(String str, String str2, final OnSearchListener onSearchListener) {
        SearchFileBeanByName searchFileBeanByName = new SearchFileBeanByName();
        SearchFileBeanByName.HeadBean headBean = new SearchFileBeanByName.HeadBean();
        headBean.setCmd("4002");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        SearchFileBeanByName.BodyBean.ResultBean resultBean = new SearchFileBeanByName.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        SearchFileBeanByName.BodyBean.DataBean dataBean = new SearchFileBeanByName.BodyBean.DataBean();
        dataBean.setSoft_code(str);
        dataBean.setScript_name(str2);
        dataBean.setEnabled_down(1);
        dataBean.setChecked_flag(1);
        dataBean.setPage_count(10);
        dataBean.setDown_num("desc");
        dataBean.setPage_no(1);
        SearchFileBeanByName.BodyBean bodyBean = new SearchFileBeanByName.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        searchFileBeanByName.setHead(headBean);
        searchFileBeanByName.setBody(bodyBean);
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/qry")).content(new Gson().toJson(searchFileBeanByName)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass8 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                OnSearchListener onSearchListener = onSearchListener;
//                if (onSearchListener != null) {
//                    onSearchListener.result(false, null);
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                LogUtil.d(ShareSDK.TAG, "搜索：" + str);
//                try {
//                    List<ShareBean> script_list = ((SearchFileBeanRes) new Gson().fromJson(str, SearchFileBeanRes.class)).getBody().getData().getScript_list();
//                    OnSearchListener onSearchListener = onSearchListener;
//                    if (onSearchListener != null) {
//                        onSearchListener.result(true, script_list);
//                    }
//                } catch (Exception e) {
//                    e.printStackTrace();
//                    OnSearchListener onSearchListener2 = onSearchListener;
//                    if (onSearchListener2 != null) {
//                        onSearchListener2.result(true, null);
//                    }
//                }
//            }
//        });
    }

    public void searchFileByType(String str, String str2, int i, final OnSearchListener onSearchListener) {
        if (str2.equals("top")) {
            searchFileByTop(str, i, onSearchListener);
            return;
        }
        LogUtil.d(TAG, "fileType:" + str2);
        SearchFileBeanByType searchFileBeanByType = new SearchFileBeanByType();
        SearchFileBeanByType.HeadBean headBean = new SearchFileBeanByType.HeadBean();
        headBean.setCmd("4002");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        SearchFileBeanByType.BodyBean.ResultBean resultBean = new SearchFileBeanByType.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        SearchFileBeanByType.BodyBean.DataBean dataBean = new SearchFileBeanByType.BodyBean.DataBean();
        dataBean.setSoft_code(str);
        dataBean.setScript_type_code(str2);
        dataBean.setPage_no(i);
        dataBean.setEnabled_down(1);
        dataBean.setChecked_flag(1);
        dataBean.setPage_count(10);
        dataBean.setDown_num("desc");
        SearchFileBeanByType.BodyBean bodyBean = new SearchFileBeanByType.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        searchFileBeanByType.setHead(headBean);
        searchFileBeanByType.setBody(bodyBean);
        LogUtil.d(TAG, "请求：" + new Gson().toJson(searchFileBeanByType));
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/qry")).content(new Gson().toJson(searchFileBeanByType)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass9 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                OnSearchListener onSearchListener = onSearchListener;
//                if (onSearchListener != null) {
//                    onSearchListener.result(false, null);
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                LogUtil.d(ShareSDK.TAG, "请求返回：" + str);
//                try {
//                    List<ShareBean> script_list = ((SearchFileBeanRes) new Gson().fromJson(str, SearchFileBeanRes.class)).getBody().getData().getScript_list();
//                    LogUtil.d(ShareSDK.TAG, "查询结果条数：" + script_list.size());
//                    OnSearchListener onSearchListener = onSearchListener;
//                    if (onSearchListener != null) {
//                        onSearchListener.result(true, script_list);
//                    }
//                } catch (Exception e) {
//                    e.printStackTrace();
//                    OnSearchListener onSearchListener2 = onSearchListener;
//                    if (onSearchListener2 != null) {
//                        onSearchListener2.result(false, null);
//                    }
//                }
//            }
//        });
    }

    public void searchFileByTop(String str, int i, final OnSearchListener onSearchListener) {
        SearchFileBeanByTop searchFileBeanByTop = new SearchFileBeanByTop();
        SearchFileBeanByTop.HeadBean headBean = new SearchFileBeanByTop.HeadBean();
        headBean.setCmd("4002");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        SearchFileBeanByTop.BodyBean.ResultBean resultBean = new SearchFileBeanByTop.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        SearchFileBeanByTop.BodyBean.DataBean dataBean = new SearchFileBeanByTop.BodyBean.DataBean();
        dataBean.setSoft_code(str);
        dataBean.setPage_no(i);
        dataBean.setEnabled_down(1);
        dataBean.setChecked_flag(1);
        dataBean.setPage_count(30);
        dataBean.setDown_num("desc");
        SearchFileBeanByTop.BodyBean bodyBean = new SearchFileBeanByTop.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        searchFileBeanByTop.setHead(headBean);
        searchFileBeanByTop.setBody(bodyBean);
        LogUtil.d(TAG, "请求：" + new Gson().toJson(searchFileBeanByTop));
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/qry")).content(new Gson().toJson(searchFileBeanByTop)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass10 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                if (onSearchListener != null) {
//                    onSearchListener.result(false, null);
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                LogUtil.d(ShareSDK.TAG, "请求返回：" + str);
//                try {
//                    List<ShareBean> script_list = ((SearchFileBeanRes) new Gson().fromJson(str, SearchFileBeanRes.class)).getBody().getData().getScript_list();
//                    LogUtil.d(ShareSDK.TAG, "查询结果条数：" + script_list.size());
//                    if (onSearchListener != null) {
//                        onSearchListener.result(true, script_list);
//                    }
//                } catch (Exception e) {
//                    e.printStackTrace();
//                    OnSearchListener onSearchListener2 = onSearchListener;
//                    if (onSearchListener2 != null) {
//                        onSearchListener2.result(true, null);
//                    }
//                }
//            }
//        });
    }

    public void searchFileByPackName(String str, int i, final OnSearchListener onSearchListener) {
        SearchFileBean searchFileBean = new SearchFileBean();
        SearchFileBean.HeadBean headBean = new SearchFileBean.HeadBean();
        headBean.setCmd("4002");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        SearchFileBean.BodyBean.ResultBean resultBean = new SearchFileBean.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        SearchFileBean.BodyBean.DataBean dataBean = new SearchFileBean.BodyBean.DataBean();
        dataBean.setSoft_code(str);
        dataBean.setPage_no(i);
        dataBean.setEnabled_down(1);
        dataBean.setChecked_flag(1);
        SearchFileBean.BodyBean bodyBean = new SearchFileBean.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        searchFileBean.setHead(headBean);
        searchFileBean.setBody(bodyBean);
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/qry")).content(new Gson().toJson(searchFileBean)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass11 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                OnSearchListener onSearchListener = onSearchListener;
//                if (onSearchListener != null) {
//                    onSearchListener.result(false, null);
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                LogUtil.d(ShareSDK.TAG, "查询：" + str);
//                try {
//                    List<ShareBean> script_list = ((SearchFileBeanRes) new Gson().fromJson(str, SearchFileBeanRes.class)).getBody().getData().getScript_list();
//                    OnSearchListener onSearchListener = onSearchListener;
//                    if (onSearchListener != null) {
//                        onSearchListener.result(true, script_list);
//                    }
//                } catch (Exception e) {
//                    e.printStackTrace();
//                    OnSearchListener onSearchListener2 = onSearchListener;
//                    if (onSearchListener2 != null) {
//                        onSearchListener2.result(false, null);
//                    }
//                }
//            }
//        });
    }

    public void delFile(String str, final OnBasicListener onBasicListener) {
        AdminFileBean adminFileBean = new AdminFileBean();
        AdminFileBean.HeadBean headBean = new AdminFileBean.HeadBean();
        headBean.setCmd("4003");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        AdminFileBean.BodyBean.ResultBean resultBean = new AdminFileBean.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        AdminFileBean.BodyBean.DataBean dataBean = new AdminFileBean.BodyBean.DataBean();
        dataBean.setAction_code("del");
        dataBean.setScript_id_list(str);
        AdminFileBean.BodyBean bodyBean = new AdminFileBean.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        adminFileBean.setHead(headBean);
        adminFileBean.setBody(bodyBean);
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/manager")).content(new Gson().toJson(adminFileBean)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass12 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                OnBasicListener onBasicListener = onBasicListener;
//                if (onBasicListener != null) {
//                    onBasicListener.result(false, "");
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                OnBasicListener onBasicListener = onBasicListener;
//                if (onBasicListener != null) {
//                    onBasicListener.result(true, "");
//                }
//            }
//        });
    }

    public void checkFile(String str, final OnBasicListener onBasicListener) {
        AdminFileBean adminFileBean = new AdminFileBean();
        AdminFileBean.HeadBean headBean = new AdminFileBean.HeadBean();
        headBean.setCmd("4003");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        AdminFileBean.BodyBean.ResultBean resultBean = new AdminFileBean.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        AdminFileBean.BodyBean.DataBean dataBean = new AdminFileBean.BodyBean.DataBean();
        dataBean.setAction_code("checked");
        dataBean.setScript_id_list(str);
        AdminFileBean.BodyBean bodyBean = new AdminFileBean.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        adminFileBean.setHead(headBean);
        adminFileBean.setBody(bodyBean);
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/manager")).content(new Gson().toJson(adminFileBean)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass13 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                OnBasicListener onBasicListener = onBasicListener;
//                if (onBasicListener != null) {
//                    onBasicListener.result(false, "");
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                OnBasicListener onBasicListener = onBasicListener;
//                if (onBasicListener != null) {
//                    onBasicListener.result(true, "");
//                }
//            }
//        });
    }

    public void downFile(String str, final String str2, final OnDownListener onDownListener) {
        noteFile(str, str2, new OnBasicListener() {
            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass14 */

            @Override // com.lmiot.xyclick.inteface.OnBasicListener
            public void result(boolean z, String str) {
                if (z) {
                    DownloadFileBean downloadFileBean = new DownloadFileBean();
                    DownloadFileBean.HeadBean headBean = new DownloadFileBean.HeadBean();
                    headBean.setCmd("4005");
                    headBean.setSession_id("000000000");
                    headBean.setTime_stamp(System.currentTimeMillis() + "");
                    DownloadFileBean.BodyBean.ResultBean resultBean = new DownloadFileBean.BodyBean.ResultBean();
                    resultBean.setErrcode("-1");
                    resultBean.setErrmsg("");
                    DownloadFileBean.BodyBean.DataBean dataBean = new DownloadFileBean.BodyBean.DataBean();
                    dataBean.setScript_id(str2);
                    DownloadFileBean.BodyBean bodyBean = new DownloadFileBean.BodyBean();
                    bodyBean.setData(dataBean);
                    bodyBean.setResult(resultBean);
                    downloadFileBean.setHead(headBean);
                    downloadFileBean.setBody(bodyBean);
//                    ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/getscript")).content(new Gson().toJson(downloadFileBean)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//                        /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass14.AnonymousClass1 */
//
//                        @Override // com.zhy.http.okhttp.callback.Callback
//                        public void onError(Call call, Exception exc) {
//                            if (onDownListener != null) {
//                                onDownListener.result(null);
//                            }
//                            exc.printStackTrace();
//                        }
//
//                        public void onResponse(String str) {
//                            LogUtil.d(ShareSDK.TAG, "下载：" + str);
//                            try {
//                                List<DownloadFileBeanRes.BodyBean.DataBean.ScriptListBean> script_list = ((DownloadFileBeanRes) new Gson().fromJson(str, DownloadFileBeanRes.class)).getBody().getData().getScript_list();
//                                if (onDownListener != null) {
//                                    onDownListener.result(script_list);
//                                }
//                            } catch (Exception e) {
//                                e.printStackTrace();
//                                if (onDownListener != null) {
//                                    onDownListener.result(null);
//                                }
//                            }
//                        }
//                    });
                    return;
                }
                if (onDownListener != null) {
                    onDownListener.result(null);
                }
            }
        });
    }

    public void noteFile(String str, String str2, final OnBasicListener onBasicListener) {
        NoteFileBean noteFileBean = new NoteFileBean();
        NoteFileBean.HeadBean headBean = new NoteFileBean.HeadBean();
        headBean.setCmd("4004");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        NoteFileBean.BodyBean.ResultBean resultBean = new NoteFileBean.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        NoteFileBean.BodyBean.DataBean dataBean = new NoteFileBean.BodyBean.DataBean();
        dataBean.setAccount_id(str);
        dataBean.setScript_id(str2);
        NoteFileBean.BodyBean bodyBean = new NoteFileBean.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        noteFileBean.setHead(headBean);
        noteFileBean.setBody(bodyBean);
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/recordscript")).content(new Gson().toJson(noteFileBean)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass15 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                if (onBasicListener != null) {
//                    onBasicListener.result(false, "");
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                OnBasicListener onBasicListener = onBasicListener;
//                if (onBasicListener != null) {
//                    onBasicListener.result(true, "");
//                }
//            }
//        });
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void addPoit(String str, String str2, String str3, String str4, int i, final OnBasicListener onBasicListener) {
        AddFilePointBean addFilePointBean = new AddFilePointBean();
        AddFilePointBean.HeadBean headBean = new AddFilePointBean.HeadBean();
        headBean.setCmd("4006");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        AddFilePointBean.BodyBean.ResultBean resultBean = new AddFilePointBean.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        AddFilePointBean.BodyBean.DataBean dataBean = new AddFilePointBean.BodyBean.DataBean();
        dataBean.setAccount_id(str);
        dataBean.setSoft_code(str2);
        dataBean.setSrc_id(str3);
        dataBean.setSrc_text(str4);
        dataBean.setAcc_point(i);
        AddFilePointBean.BodyBean bodyBean = new AddFilePointBean.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        addFilePointBean.setHead(headBean);
        addFilePointBean.setBody(bodyBean);
        LogUtil.d(TAG, "增加积分：" + new Gson().toJson(addFilePointBean));
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/addpoint")).content(new Gson().toJson(addFilePointBean)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass16 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                OnBasicListener onBasicListener = onBasicListener;
//                if (onBasicListener != null) {
//                    onBasicListener.result(false, "");
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                LogUtil.d(ShareSDK.TAG, "增加积分返回：" + str);
//                OnBasicListener onBasicListener = onBasicListener;
//                if (onBasicListener != null) {
//                    onBasicListener.result(true, "");
//                }
//            }
//        });
    }

    public void addMsg(String str, String str2, int i, String str3, String str4, final OnBasicListener onBasicListener) {
        AddMsgBean addMsgBean = new AddMsgBean();
        AddMsgBean.HeadBean headBean = new AddMsgBean.HeadBean();
        headBean.setCmd("4007");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        AddMsgBean.BodyBean.ResultBean resultBean = new AddMsgBean.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        AddMsgBean.BodyBean.DataBean dataBean = new AddMsgBean.BodyBean.DataBean();
        dataBean.setAccount_id(str);
        dataBean.setScript_id(str2);
        dataBean.setGrade_level(i + "");
        dataBean.setGrade_content(str3);
        dataBean.setRemark(str4);
        AddMsgBean.BodyBean bodyBean = new AddMsgBean.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        addMsgBean.setHead(headBean);
        addMsgBean.setBody(bodyBean);
        LogUtil.d(TAG, "999999：" + new Gson().toJson(addMsgBean));
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/addgrade")).content(new Gson().toJson(addMsgBean)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass17 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                OnBasicListener onBasicListener = onBasicListener;
//                if (onBasicListener != null) {
//                    onBasicListener.result(false, "");
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                OnBasicListener onBasicListener = onBasicListener;
//                if (onBasicListener != null) {
//                    onBasicListener.result(true, "");
//                }
//            }
//        });
    }

    public void searchMsg(String str, final OnMsgListener onMsgListener) {
        SearchMsgBean searchMsgBean = new SearchMsgBean();
        SearchMsgBean.HeadBean headBean = new SearchMsgBean.HeadBean();
        headBean.setCmd("4008");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        SearchMsgBean.BodyBean.ResultBean resultBean = new SearchMsgBean.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        SearchMsgBean.BodyBean.DataBean dataBean = new SearchMsgBean.BodyBean.DataBean();
        dataBean.setScript_id(str);
        SearchMsgBean.BodyBean bodyBean = new SearchMsgBean.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        searchMsgBean.setHead(headBean);
        searchMsgBean.setBody(bodyBean);
        LogUtil.d(TAG, "调试：" + new Gson().toJson(searchMsgBean));
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/qrygrade")).content(new Gson().toJson(searchMsgBean)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass18 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                OnMsgListener onMsgListener = onMsgListener;
//                if (onMsgListener != null) {
//                    onMsgListener.result(null);
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                LogUtil.d(ShareSDK.TAG, "response23:" + str);
//                try {
//                    List<SearchMsgBeanRes.BodyBean.DataBean.GradeListBean> grade_list = ((SearchMsgBeanRes) new Gson().fromJson(str, SearchMsgBeanRes.class)).getBody().getData().getGrade_list();
//                    OnMsgListener onMsgListener = onMsgListener;
//                    if (onMsgListener != null) {
//                        onMsgListener.result(grade_list);
//                    }
//                } catch (Exception e) {
//                    e.printStackTrace();
//                    OnMsgListener onMsgListener2 = onMsgListener;
//                    if (onMsgListener2 != null) {
//                        onMsgListener2.result(null);
//                    }
//                }
//            }
//        });
    }

    public void adminhMsg(String str, String str2, final OnBasicListener onBasicListener) {
        AdminMsgBean adminMsgBean = new AdminMsgBean();
        AdminMsgBean.HeadBean headBean = new AdminMsgBean.HeadBean();
        headBean.setCmd("4009");
        headBean.setSession_id("000000000");
        headBean.setTime_stamp(System.currentTimeMillis() + "");
        AdminMsgBean.BodyBean.ResultBean resultBean = new AdminMsgBean.BodyBean.ResultBean();
        resultBean.setErrcode("-1");
        resultBean.setErrmsg("");
        AdminMsgBean.BodyBean.DataBean dataBean = new AdminMsgBean.BodyBean.DataBean();
        dataBean.setAction_code(str);
        dataBean.setGrade_id_list(str2);
        AdminMsgBean.BodyBean bodyBean = new AdminMsgBean.BodyBean();
        bodyBean.setData(dataBean);
        bodyBean.setResult(resultBean);
        adminMsgBean.setHead(headBean);
        adminMsgBean.setBody(bodyBean);
//        ((PostStringBuilder) OkHttpUtils.postString().url("https://ai.xiaoyizhineng.com:441/script/magrgrade")).content(new Gson().toJson(adminMsgBean)).mediaType(MediaType.parse("application/json; charset=utf-8")).build().execute(new StringCallback() {
//            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass19 */
//
//            @Override // com.zhy.http.okhttp.callback.Callback
//            public void onError(Call call, Exception exc) {
//                OnBasicListener onBasicListener = onBasicListener;
//                if (onBasicListener != null) {
//                    onBasicListener.result(false, "");
//                }
//                exc.printStackTrace();
//            }
//
//            public void onResponse(String str) {
//                OnBasicListener onBasicListener = onBasicListener;
//                if (onBasicListener != null) {
//                    onBasicListener.result(true, "");
//                }
//            }
//        });
    }

    public String getUserName(String str) {
        String replace = str.replace("xyclick", "");
        if (replace.length() > 4) {
            return "***" + replace.substring(replace.length() - 4, replace.length());
        }
        return "***" + replace;
    }

    public void checkMyNum(String str, final OnBasicListener onBasicListener) {
        searchSelfFile(str, new OnSearchListener() {
            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass20 */

            @Override // com.lmiot.xyclick.Share.inteface.OnSearchListener
            public void result(boolean z, List<ShareBean> list) {
                if (list == null) {
                    list = new ArrayList<>();
                }
                LogUtil.d(ShareSDK.TAG, "script_list.size():" + list.size());
                if (list.size() >= 10) {
                    onBasicListener.result(false, "自动化已超出数量");
                } else {
                    onBasicListener.result(true, "");
                }
            }
        });
    }

    public void downTipDialog(final Context context, final int i, final int i2, final OnBasicListener onBasicListener) {
        YYSDK.getInstance().showDefine(context, false, true, R.layout.dialog_share_tip_down, new OnViewBack() {
            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass21 */

            @Override // com.youyi.yyviewsdklibrary.Dialog.interfaces.OnViewBack
            public void result(final XDialog xDialog, View view) {
                TextView textView;
                TextView textView2 = (TextView) view.findViewById(R.id.id_mian);
                TextView textView3 = (TextView) view.findViewById(R.id.id_know);
                TextView textView4 = (TextView) view.findViewById(R.id.id_color_point_my);
                TextView textView5 = (TextView) view.findViewById(R.id.id_color_point_down);
                TextView textView6 = (TextView) view.findViewById(R.id.tv_cancel);
                TextView textView7 = (TextView) view.findViewById(R.id.tv_sure);
                final CheckBox checkBox = (CheckBox) view.findViewById(R.id.id_checkbox);
                LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.bt_vip_layout);
                TextView textView8 = (TextView) view.findViewById(R.id.bt_vip);
                if (DataUtil.getVip(MyApp.getContext())) {
                    linearLayout.setVisibility(View.GONE);
                } else {
                    linearLayout.setVisibility(View.VISIBLE);
                }
                checkBox.setChecked(DataUtil.getHasReadShareDown(MyApp.getContext()));
                textView8.setOnClickListener(new View.OnClickListener() {
                    /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass21.AnonymousClass1 */

                    public void onClick(View view) {
                        Intent intent = new Intent(MyApp.getContext(), PayVIPActivity.class);
                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        context.startActivity(intent);
                    }
                });
                if (i < i2) {
                    String replaceAll = ("您目前的积分" + i + "积分").replaceAll(i + "", "<font color='#FF0000'>" + i + "</font>");
                    String replaceAll2 = ("下载需要消耗" + i2 + "积分,目前积分不足").replaceAll(i2 + "", "<font color='#FF0000'>" + i2 + "</font>");
                    textView4.setText(Html.fromHtml(replaceAll));
                    textView5.setText(Html.fromHtml(replaceAll2));
                    textView7.setText("赚取积分");
                    textView = textView6;
                } else {
                    StringBuilder sb = new StringBuilder();
                    sb.append("<font color='#FF0000'>");
                    textView = textView6;
                    sb.append(i);
                    sb.append("</font>");
                    String replaceAll3 = ("您目前的积分" + i + "积分").replaceAll(i + "", sb.toString());
                    String replaceAll4 = ("下载需要消耗" + i2 + "积分").replaceAll(i2 + "", "<font color='#FF0000'>" + i2 + "</font>");
                    StringBuilder sb2 = new StringBuilder();
                    sb2.append("replaceDown:");
                    sb2.append(replaceAll4);
                    LogUtil.d(ShareSDK.TAG, sb2.toString());
                    textView4.setText(Html.fromHtml(replaceAll3));
                    textView5.setText(Html.fromHtml(replaceAll4));
                    textView7.setText("确定下载");
                }
                textView2.setOnClickListener(new View.OnClickListener() {
                    /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass21.AnonymousClass2 */

                    public void onClick(View view) {
                        ShareSDK.this.mIntent = new Intent(context, WebViewActivity.class);
                        ShareSDK.this.mIntent.putExtra(SpFlag.k, "《免责声明》");
                        ShareSDK.this.mIntent.putExtra("url", "https://ai.xiaoyizhineng.com:441/download/HelpVideo/autoclick/state.html");
                        if (context instanceof MyApp) {
                            ShareSDK.this.mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        }
                        context.startActivity(ShareSDK.this.mIntent);
                    }
                });
                textView3.setOnClickListener(new View.OnClickListener() {
                    /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass21.AnonymousClass3 */

                    public void onClick(View view) {
                        ShareSDK.this.mIntent = new Intent(context, WebViewActivity.class);
                        ShareSDK.this.mIntent.putExtra(SpFlag.k, "《共享须知》");
                        ShareSDK.this.mIntent.putExtra("url", "https://ai.xiaoyizhineng.com:441/download/HelpVideo/autoclick/know.html");
                        if (context instanceof MyApp) {
                            ShareSDK.this.mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        }
                        context.startActivity(ShareSDK.this.mIntent);
                    }
                });
                textView.setOnClickListener(new View.OnClickListener() {
                    /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass21.AnonymousClass4 */

                    public void onClick(View view) {
                        xDialog.dismiss();
                        if (onBasicListener != null) {
                            onBasicListener.result(false, "");
                        }
                    }
                });
                textView7.setOnClickListener(new View.OnClickListener() {
                    /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass21.AnonymousClass5 */

                    public void onClick(View view) {
                        if (!checkBox.isChecked()) {
                            YYSDK.toast(YYSDK.YToastEnum.err, "请先勾选同意按钮才可继续！");
                            return;
                        }
                        DataUtil.setHasReadShareDown(MyApp.getContext(), true);
                        xDialog.dismiss();
                        if (onBasicListener != null) {
                            onBasicListener.result(true, "");
                        }
                    }
                });
            }
        });
    }

    public void uploadTipDialog(final Context context, final OnBasicListener onBasicListener) {
        YYSDK.getInstance().showDefine(context, false, true, R.layout.dialog_share_tip_upload, new OnViewBack() {
            /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass22 */

            @Override // com.youyi.yyviewsdklibrary.Dialog.interfaces.OnViewBack
            public void result(final XDialog xDialog, View view) {
                final CheckBox checkBox = (CheckBox) view.findViewById(R.id.id_checkbox);
                checkBox.setChecked(DataUtil.getHasReadShareUpload(MyApp.getContext()));
                ((TextView) view.findViewById(R.id.id_mian)).setOnClickListener(new View.OnClickListener() {
                    /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass22.AnonymousClass1 */

                    public void onClick(View view) {
                        ShareSDK.this.mIntent = new Intent(context, WebViewActivity.class);
                        ShareSDK.this.mIntent.putExtra(SpFlag.k, "《免责声明》");
                        ShareSDK.this.mIntent.putExtra("url", "https://ai.xiaoyizhineng.com:441/download/HelpVideo/autoclick/state.html");
                        if (context instanceof MyApp) {
                            ShareSDK.this.mIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        }
                        context.startActivity(ShareSDK.this.mIntent);
                    }
                });
                ((TextView) view.findViewById(R.id.id_know)).setOnClickListener(new View.OnClickListener() {
                    /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass22.AnonymousClass2 */

                    public void onClick(View view) {
                        ShareSDK.this.mIntent = new Intent(context, WebViewActivity.class);
                        ShareSDK.this.mIntent.putExtra(SpFlag.k, "《共享须知》");
                        ShareSDK.this.mIntent.putExtra("url", "https://ai.xiaoyizhineng.com:441/download/HelpVideo/autoclick/know.html");
                        if (context instanceof MyApp) {
                            Intent intent = ShareSDK.this.mIntent;
                            Intent unused = ShareSDK.this.mIntent;
                            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        }
                        context.startActivity(ShareSDK.this.mIntent);
                    }
                });
                ((TextView) view.findViewById(R.id.tv_cancel)).setOnClickListener(new View.OnClickListener() {
                    /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass22.AnonymousClass3 */

                    public void onClick(View view) {
                        xDialog.dismiss();
                        if (onBasicListener != null) {
                            onBasicListener.result(false, "");
                        }
                    }
                });
                ((TextView) view.findViewById(R.id.tv_sure)).setOnClickListener(new View.OnClickListener() {
                    /* class com.lmiot.xyclick.Share.ShareSDK.AnonymousClass22.AnonymousClass4 */

                    public void onClick(View view) {
                        if (!checkBox.isChecked()) {
                            YYSDK.toast(YYSDK.YToastEnum.err, "请先勾选同意按钮才可继续！");
                            return;
                        }
                        DataUtil.setHasReadShareUpload(MyApp.getContext(), true);
                        xDialog.dismiss();
                        if (onBasicListener != null) {
                            onBasicListener.result(true, "");
                        }
                    }
                });
            }
        });
    }

    public String getTypeName(String str) {
        if (TextUtils.isEmpty(str)) {
            return "未知";
        }
        ShareTypeEnum[] values = ShareTypeEnum.values();
        for (ShareTypeEnum shareTypeEnum : values) {
            if (shareTypeEnum.getTypeCode().equals(str)) {
                return shareTypeEnum.getName();
            }
        }
        return "未知";
    }
}
